var pipeLineId = "";
var pipepipeSegmentId = "";




// 管线选择点击事件
function pipeSegmentClick(id) {
	// 对管段ID进行诸如
	pipeSegmentId = id;

}

function getClosureClick() {
	// 获取一个起始点
	var startMileage = $("#startMileageId").val();
	
	// 获取一个终点
	var endMileage = $("#endMileageId").val();
	

	var url = window.config.controlServer + "/basedata/closure/findByCondition.json";
	//清空子节点
	$("#searchBody").empty();
	
	//$("#closureTableId").append("<ul class=\"ul-header\"><li class=\"w20\">管道名称</li><li class=\"w20\">管段名称</li><li class=\"w10\">封堵物编号</li><li class=\"w20\">无损检测类型</li><li class=\"w20\">绝对距离</li><li class=\"w10 no-right\">操作</li></ul>");
	
	var data = {"lineId":pipeLineId,"segmentId":pipeSegmentId,"startMileage":startMileage,"endMileage":endMileage};
		var map={"fillDiv":"#searchBody",
	            "url":window.config.controlServer+"basedata/closure/findByCondition.json"};
		searchPage(map,data);

}

function createProHtml(p,i){
      var html='';
      // 表主键ID
		var closureid = p.CLOSUREID;
		if (closureid == "" || closureid == null) {
			closureid = "-";
		}

		// 管线名称
		var LINENAME = p.LINENAME;
		if ("" == LINENAME || null == LINENAME) {
			LINENAME = "-";
		}

		// 管段名称
		var SEGMENTNAME = p.SEGMENTNAME;
		if ("" == SEGMENTNAME || null == SEGMENTNAME) {
			SEGMENTNAME = "-";
		}
		// 封堵物编号
		var CLOSUREID = p.CLOSUREID;
		if ("" == CLOSUREID || null == CLOSUREID) {
			CLOSUREID = "-";
		}
		// 封堵物类型
		var CLOSURETYPE = p.CLOSURETYPE;
		if ("" == CLOSURETYPE || null == CLOSURETYPE) {
			CLOSURETYPE = "-";
		}
		// 封堵物材料
		var CLOSUREMATERIAL = p.CLOSUREMATERIAL;
		if ("" == CLOSUREMATERIAL || null == CLOSUREMATERIAL) {
			CLOSUREMATERIAL = "-";
		}
		// "绝对距离（m）"
		var GPMILEAGE = p.GPMILEAGE;
		if ("" == GPMILEAGE || null == GPMILEAGE) {
			GPMILEAGE = "-";
		}
		// 最近参考点
		var GPREFERENCE = p.GPREFERENCE;
		if ("" == GPREFERENCE || null == GPREFERENCE) {
			GPREFERENCE = "-";
		}
		// "相对最近参考点距离（m）"
		var GPREFERENCEDISTANCE = p.GPREFERENCEDISTANCE;
		if ("" == GPREFERENCEDISTANCE
				|| null == GPREFERENCEDISTANCE) {
			GPREFERENCEDISTANCE = "-";
		}
		// 封堵物防腐材料
		var ANTISEPTICMATERIAL = p.ANTISEPTICMATERIAL;
		if ("" == ANTISEPTICMATERIAL
				|| null == ANTISEPTICMATERIAL) {
			ANTISEPTICMATERIAL = "-";
		}
		// 压力等级（MPa）
		var PRESSURERATING = p.PRESSURERATING;
		if ("" == PRESSURERATING || null == PRESSURERATING) {
			PRESSURERATING = "-";
		}
		// 投用日期
		var INSERVICEDATE = p.INSERVICEDATE;
		if ("" == INSERVICEDATE || null == INSERVICEDATE) {
			INSERVICEDATE = "-";
		}
		// 施工单位
		var ASSEMBLYCOMPANY = p.ASSEMBLYCOMPANY;
		if ("" == ASSEMBLYCOMPANY || null == ASSEMBLYCOMPANY) {
			ASSEMBLYCOMPANY = "-";
		}
		// 监理单位
		var INSPECTINGCOMPANY = p.INSPECTINGCOMPANY;
		if ("" == INSPECTINGCOMPANY
				|| null == INSPECTINGCOMPANY) {
			INSPECTINGCOMPANY = "-";
		}
		// 检测单位
		var TESTINGCOMPANY = p.TESTINGCOMPANY;
		if ("" == TESTINGCOMPANY || null == TESTINGCOMPANY) {
			TESTINGCOMPANY = "-";
		}
		// 记录人
		var RECORDER = p.RECORDER;
		if ("" == RECORDER || null == RECORDER) {
			RECORDER = "-";
		}
		// 记录时间
		var RECORDTIME = p.RECORDTIME;
		if ("" == RECORDTIME || null == RECORDTIME) {
			RECORDTIME = "-";
		}
		// 备注
		var CREATEREMARK = p.CREATEREMARK;
		if ("" == CREATEREMARK || null == CREATEREMARK) {
			CREATEREMARK = "-";
		}

		/*// GISID
		var GIS_ID = "";
		if ("" == list || null == list || "" == p.GISID
				|| null == p.GISID) {
			GIS_ID = "-";
		} else {
			GIS_ID = p.GISID;
			// 对GISID注入到数组中
			gisIdArray[i] = GIS_ID;

		}*/

		// 通过判断定义头样式
		var sty = "bg-second";
		if (i % 2) {
			sty = "bg-white";
		}
		// 追加HTML
		//htmlhead    += '<ul class=\"ul-header\"><li class=\"w20\">管道名称</li><li class=\"w20\">管段名称</li><li class=\"w10\">封堵物编号</li><li class=\"w20\">无损检测类型</li><li class=\"w20\">绝对距离</li><li class=\"w10 no-right\">操作</li></ul>'
		html	+='<div class=\"info-tr\"><ul class=\"ul-header '
				+ sty
				+ '\"><li class=\"w20\">'
				+ LINENAME
				+ '</li><li class=\"w20\">'
				+ SEGMENTNAME
				+ '</li><li class=\"w10\">'
				+ CLOSUREID
				+ '</li><li class=\"w20\">'
				+ CLOSURETYPE
				+ '</li><li class=\"w20\" dateStyle=\"default\">'
				+ CLOSUREMATERIAL
				+ '</li><li class=\"w10 no-right\"><em class=\"xq-icon\" ></em></li></ul><div class=\"show-ul none\"><ul class=\"show-list\"><li><span class=\"s1\">管道名称:</span><span class=\"s2\">'
				+ LINENAME
				+ '</span></li><li><span class="s1">管段名称:</span><span class="s2">'
				+ SEGMENTNAME
				+ '</span></li><li><span class=\"s1\">封堵物编号:</span><span class=\"s2\">'
				+ CLOSUREID
				+ '</span></li><li><span class=\"s1\">封堵物类型:</span><span class=\"s2\">'
				+ CLOSURETYPE
				+ '</span></li><li><span class=\"s1\">封堵物材料:</span><span class=\"s2\">'
				+ CLOSUREMATERIAL
				+ '</span></li><li><span class=\"s1\">绝对距离（m）:</span><span class=\"s2\">'
				+ GPMILEAGE
				+ '</span></li><li><span class=\"s1\">最近参考点:</span><span class=\"s2\">'
				+ GPREFERENCE
				+ '</span></li><li><span class=\"s1\">相对最近参考点距离（m）:</span><span class=\"s2\">'
				+ GPREFERENCEDISTANCE
				+ '</span></li><li><span class=\"s1\">封堵物防腐材料:</span><span class=\"s2\">'
				+ ANTISEPTICMATERIAL
				+ '</span></li><li><span class=\"s1\">压力等级（MPa）:</span><span class=\"s2\">'
				+ PRESSURERATING
				+ '</span></li><li><span class=\"s1\">投用日期:</span><span class=\"s2\">'
				+ INSERVICEDATE
				+ '</span></li><li><span class=\"s1\">施工单位:</span><span class=\"s2\">'
				+ ASSEMBLYCOMPANY
				+ '</span></li><li><span class=\"s1\">监理单位:</span><span class=\"s2\">'
				+ INSPECTINGCOMPANY
				+ '</span></li><li><span class=\"s1\">检测单位:</span><span class=\"s2\">'
				+ TESTINGCOMPANY
				+ '</span></li><li><span class=\"s1\">记录人:</span><span class=\"s2\">'
				+ RECORDER
				+ '</span></li><li><span class=\"s1\">记录时间:</span><span class=\"s2\">'
				+ RECORDTIME
				+ '</span></li><li class=\"last-li\"><span class=\"s1\">备注:</span><span class=\"s2\"><textarea placeholder=\"备注描述\" disabled=\"disabled\" readonly=\"readonly\">'
				+ CREATEREMARK
				+ '</textarea></span></li></ul></div></div>';
      return html;
}